var express = require("express");
var path = require("path");
var router = express.Router();
var adminController = require(path.join(
  process.cwd(),
  "/controller/adminController"
));

/* GET home page. */
//管理员注册
router.post("/regist", adminController.register);

//管理员登录
router.post("/login", adminController.useridLogin);

//获取视频列表
router.get("/getvideolist", adminController.getVideoList);

//获取用户列表
router.get("/getuserlist", adminController.getUserList);

//删除某个视频
router.delete("/removevideo", adminController.removeVideo);

//删除某个用户
router.delete("/removeuser", adminController.removeUser);

//删除视频标签
router.delete("/removevideolabel", adminController.removeVideoLabel);

//添加视频标签
router.post("/addvideolabel", adminController.addVideoLabel);

//根据用户地区进行统计
router.get("/groupbyuserlocation", adminController.groupbyUserLocation);

//根据用户性别进行统计
router.get("/groupbygender", adminController.groupByGender);

//根据视频地区进行统计
router.get("/groupbyvideolocation", adminController.groupbyVideoLocation);

//根据视频风格类型进行统计
router.get("/groupbyvideolabel", adminController.groupByVideoLabel);

//根据视频发布时间进行统计
router.get("/groupbypublictime", adminController.groupByPublicTime);

//根据视频发布时间进行统计
router.get("/groupbypublictime", adminController.groupByPublicTime);

//根据用户id进行排序
router.get("/rankbyuserid", adminController.rankByUserId);

//根据用户名字进行排序
router.get("/rankbyname", adminController.rankByName);

//根据喜欢人数进行排序
router.get("/getvideorankbylikenum", adminController.getVideoRankByLikeNum);

router.post("/findVideos", adminController.findVideos);

router.post("/findUsers", adminController.findUsers);
router.post("/editVideos", adminController.editVideos);
router.post("/editUsers", adminController.editUsers);
router.post("/findAdminUsers", adminController.findAdminUsers);
router.post("/editAdminUsers", adminController.editAdminUsers);
router.delete("/deleteAdminUsers", adminController.deleteAdminUsers);

module.exports = router;
